﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ERPStore.Models
{
    [Serializable]
    public class CustomerCreditScore
    {
        public CustomerCreditScore()
        {
            AllowDeferredPayment = false;
            CurrentCredit = 0;
            DefaultAllowedCredit = 0;
            IsLocked = false;
        }
        /// <summary>
        /// La société peut payer de manière differée
        /// </summary>
        /// <value>
        /// 	<c>true</c> if [allow deferred payment]; otherwise, <c>false</c>.
        /// </value>
        public bool AllowDeferredPayment { get; set; }
        /// <summary>
        /// Montant total de l'encours (BL + Factures non reglés)
        /// </summary>
        /// <value>The current credit.</value>
        public decimal CurrentCredit { get; set; }
        /// <summary>
        /// Montant de l'encours accordé par defaut
        /// </summary>
        /// <value>The default allowed credit.</value>
        public decimal DefaultAllowedCredit { get; set; }
        /// <summary>
        /// Indique que le client est verrouillé
        /// </summary>
        /// <value><c>true</c> if this instance is locked; otherwise, <c>false</c>.</value>
        public bool IsLocked { get; set; }
        /// <summary>
        /// Indique que le client est couvert par une assurance crédit
        /// </summary>
        /// <value>
        /// 	<c>true</c> if this instance is insured; otherwise, <c>false</c>.
        /// </value>
        public bool IsInsured { get; set; }
        /// <summary>
        /// Montant restant du crédit
        /// </summary>
        /// <value>The remaining credit.</value>
        public decimal RemainingCredit
        {
            get
            {
                return DefaultAllowedCredit - CurrentCredit;
            }
        }
    }
}
